<div class="pagination">
    <ul>
        {% for page in current_page.page_range %}
            {% if not page %}
                ...
            {% else %}
                {% ifequal page current_page.number %}
                    <li><a href="?page={{page}}&sort={{sort}}" class='current_page'>{{page}}</a></li>
                {% else %}
                    <li><a href="?page={{page}}&sort={{sort}}">{{page}}</a></li>
                {% endifequal %}
            {% endif %}
        {% endfor %}
        {% if current_page.has_next %}
            <li><a href="?page={{current_page.next_page_number }}&sort={{sort}}">Next</a></li>
        {% endif %}
    </ul>
</div>
